import { Navigate } from "react-router-dom"
import { isAuth } from "@/utils/token"

export default function AuthRoute({ element }) {
  return (
    <>
      {isAuth() ? element : <Navigate to="/login" replace={true} />}
    </>
  )
}